package com.test.prolenders.dialog_prolenders;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.test.prolenders.R;


public class BindAccountTipDialog_Fr_prolenders extends Dialog {

    private final Runnable submitRunnable;

    public BindAccountTipDialog_Fr_prolenders(@NonNull Context context, Runnable submitRunnable) {
        super(context);
        this.submitRunnable = submitRunnable;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_bind_account_tip_fr_prolenders);
        initView();
    }

    @SuppressLint("SetTextI18n")
    private void initView(){

        getWindow().setBackgroundDrawableResource(R.color.transparent_prolenders);
        setCanceledOnTouchOutside(false);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        findViewById(R.id.dbatf_btn_1).setOnClickListener(v -> dismiss());

        findViewById(R.id.dbatf_btn_2).setOnClickListener(v -> {
            dismiss();
            if (submitRunnable!=null) submitRunnable.run();
        });
    }

}
